<?php
/**
* @package Scribble
* @subpackage SkeletonApp
*/
use Buan\ExtensionManager;
use Buan\View;

View::getGlobalView()->addStylesheets('screen', "{$baseUrl}/front-end.css");
$content = $page->getInnerContent()->content;
?>

<!--
# Main page content
-->
<h2><?php $this->html->e($content->heading); ?></h2>
<?php echo $content->content; ?>


<!--
# List previously added comments
-->
<?php if($page->getCommentCount(TRUE)>0): ?>
	<hr />
	<h3>Comments</h3>
	<ol>
	<?php foreach($page->findModeratedComments() as $comment): ?>
		<li>
			<img src="<?php $this->html->e($comment->getGravatarUrl(50)); ?>" width="50" height="50" alt="<?php $this->html->e($comment->authorname); ?>" />
			<cite>
				<?php if($comment->authorwww!=''): ?>
					<a href="<?php $this->html->e($comment->authorwww); ?>" rel="external nofollow"><?php $this->html->e($comment->authorname); ?></a>
				<?php else: ?>
					<?php $this->html->e($comment->authorname); ?>
				<?php endif; ?>
			</cite> says ...
			<p>
				<?php echo $comment->getBodyHtml(); ?>
			</p>
		</li>
	<?php endforeach; ?>
	</ol>
<?php endif; ?>


<!--
# Form to add comments
# Note there is no "action" parameter on the form. This will result in the form
# being submitted to this same page - just what we want.
-->
<hr/>
<h3>Add a comment</h3>
<form class="form" method="post">
	<dl>
		<dt>Comment: *</dt>
		<dt class="aid">Absolute URLs (ie. http://...) will be linked automatically. Markup disabled.</dt>
		<dd><textarea name="body" rows="10" cols="20"></textarea></dd>
	</dl>

	<dl>
		<dt>Your name:</dt>
		<dd><input type="text" name="authorname" value="" /></dd>
	</dl>

	<dl>
		<dt>Your email: *</dt>
		<dt class="aid">Required, but hidden. <a href="http://www.gravatar.com/" rel="external" class="external">Gravatars</a> are enabled.</dt>
		<dd><input type="text" name="authoremail" value="" /></dd>
	</dl>

	<dl>
		<dt>Your website address:</dt>
		<dd><input type="text" name="authorwww" value="" /></dd>
	</dl>

	<dl class="buttons">
		<dd><input type="submit" value="Submit" /></dd>
	</dl>
</form>